package com.kili.mirco.spark_als.ref.cmp;

import lombok.Data;
import scala.Tuple2;

import java.util.Comparator;

/**
 * @date 19-6-4
 * @auther jackliang
 * @description TODO
 */
@Data
public class MatrixComparetor implements Comparator<Tuple2<Object, Double>>, java.io.Serializable {

    public static final MatrixComparetor MC_CMP = new MatrixComparetor();

    @Override
    public int compare(Tuple2<Object, Double> o1, Tuple2<Object, Double> o2) {
        return Double.valueOf(o1._2 - o2._2).intValue();
    }

}
